package com.hjx.movie.common.utils;

/**
 * <p>Title:</p>
 * <p>Description:</p>
 *
 * @author hjx
 * @date 2020/12/26 - 1:58
 */
public enum LoginType {
    PASSWORD_LOGIN(4,"密码登录"),
    CAPTCHA_LOGIN(5,"验证码登录"),
    USERNAME_LOGIN(1,"帐号登录"),
    EMAIL_LOGIN(2,"邮箱登录"),
    PHONE_LOGIN(3,"手机登录");

    private final Integer typeCode;
    private final String message;
    LoginType(Integer typeCode, String message){
        this.typeCode = typeCode;
        this.message = message;
    }

    public int getTypeCode() {
        return typeCode;
    }

    public String getMessage() {
        return message;
    }

    public static Integer checkLoginType(String loginType){
        Integer result = LoginType.USERNAME_LOGIN.typeCode;
        switch (loginType){
            case "1":
                result= LoginType.USERNAME_LOGIN.typeCode;
                break;
            case "2":
                result= LoginType.EMAIL_LOGIN.typeCode;
                break;
            case "3":
                result= LoginType.PHONE_LOGIN.typeCode;
                break;
        }
        return result;
    }
}
